﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Modules.Core;

namespace ComputerStoreManager.ViewModel {
    public delegate void OnEmployeeControlAddEmployeeEventHander();
    public delegate void OnEmployeeControlViewEmployeeEventHander();
    public class EmployeeControlViewModel : BaseViewModel {

        #region Variables
        private bool m_isVisibleEmployeeLeftPanel = false;
        #endregion

        #region Events
        public event OnEmployeeControlAddEmployeeEventHander OnAddEmployeeClicked;
        public event OnEmployeeControlViewEmployeeEventHander OnViewEmployeeClicked;
        #endregion

        #region ICommand
        public ICommand AddEmpCommand {
            get;
            private set;
        }
        public ICommand ViewEmpCommand {
            get;
            private set;
        }
        #endregion

        #region InitCmd

        #region Constructor
        public EmployeeControlViewModel() {
            InitCmd();
        }
        #endregion

        public void InitCmd() {
            AddEmpCommand = new ExecutableCommand(DoAddEmpCommand);
            ViewEmpCommand = new ExecutableCommand(DoViewEmpCommand);
        }

        private void DoViewEmpCommand() {
            if (OnViewEmployeeClicked != null) {
                OnViewEmployeeClicked();
            }
        }

        private void DoAddEmpCommand() {
            if (OnAddEmployeeClicked != null) {
                OnAddEmployeeClicked();
            }
        }
        #endregion

        #region Properties
        public bool IsVisibleEmployeeLeftPanel {
            get {
                return m_isVisibleEmployeeLeftPanel;
            }
            set {
                m_isVisibleEmployeeLeftPanel = value;
                OnPropertyChanged("IsVisibleEmployeeLeftPanel");
            }
        }
        #endregion

    }
}
